<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.5.17/vue.js"></script>
</head>
<body>
    <div id="app2">
        <cpn2></cpn2>
        <cpn1></cpn1>
    </div>
    <script>
        // 1.创建第一个  组件构造实例 （子组件）
        let cpnC1 = Vue.extend({
            template:`
            <div>
            <h2>title1</h2>
            <p>response1</p>
        </div>
            `
        })
        //2.创建第二个  组件构造实例 (父组件)
        let cpnC2 = Vue.extend({
            template:`
            <div>
            <h2>title2 </h2>
            <p>response2</p>
            <cpn1></cpn1>
        </div>
            `,
            components:{
                cpn1:cpnC1
            }
        })

        let app2 = new Vue({
            el:'#app2',
            data:{
                
            },
            components:{
                'cpn2':cpnC2,
                cpn1:cpnC1
            }
        })
    </script>
</body>
</html>